import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
/*import {DescItem} from "@/components/Description/index";
import {h} from "vue";
import {JsonPreview} from "@/components/CodeEditor";*/

export const columns: BasicColumn[] = [
  {
    title: '系统订单号',
    dataIndex: 'orderid',
    width: 160
  },
  {
    title: '唛头',
    dataIndex: 'shippingMark',
    width: 160
  },
  {
    title: '订舱单号',
    dataIndex: 'bookingNumber',
    width: 160
  },
  {
    title: '货物品名',
    dataIndex: 'goodsName',
    width: 160
  },
  {
    title: '货物类型',
    dataIndex: 'goodsType',
    width: 160
  },
  {
    title: '订单状态',
    dataIndex: 'orderState',
    width: 160
  },
  {
    title: '总件数',
    dataIndex: 'total',
    width: 160
  },
  {
    title: '总重量(KG)',
    dataIndex: 'weight',
    width: 160
  },
  {
    title: '总体积(CBM)',
    dataIndex: 'volume',
    width: 160
  },
  {
    title: '系统柜号',
    dataIndex: 'systemContainernumber',
    width: 160
  },
  {
    title: '入仓单号',
    dataIndex: 'warehouseEntryNumber',
    width: 160
  },
  {
    title: '入仓时间',
    dataIndex: 'warehousingTime',
    width: 180,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    }
  },
  {
    title: '产品名称',
    dataIndex: 'productName',
    width: 160
  },
  {
    title: '客户名称',
    dataIndex: 'customerName',
    width: 160
  },
  {
    title: '客户类型',
    dataIndex: 'customerType',
    width: 160
  },
  {
    title: '客服',
    dataIndex: 'customerService',
    width: 160
  },
  {
    title: '销售',
    dataIndex: 'sales',
    width: 160
  },
  {
    title: '销售部门',
    dataIndex: 'salesDepartment',
    width: 160
  },
  {
    title: '产品部门',
    dataIndex: 'productDepartment',
    width: 160
  },
  {
    title: '产品公司',
    dataIndex: 'productCompany',
    width: 160
  },
  {
    title: '业务类型',
    dataIndex: 'businessType',
    width: 160
  },
  {
    title: '内部结算价',
    dataIndex: 'insidePrice',
    width: 160
  },
  {
    title: '应收状态',
    dataIndex: 'receivableState',
    width: 160
  },
  {
    title: '应收价格',
    dataIndex: 'receivablePrice',
    width: 160
  },
  {
    title: '因收币种',
    dataIndex: 'currencyType',
    width: 160
  },
  {
    title: '起始港',
    dataIndex: 'portOfOrigin',
    width: 160
  },
  {
    title: '目的港',
    dataIndex: 'portOfDestination',
    width: 160
  },
  {
    title: '仓库',
    dataIndex: 'warehouse',
    width: 160
  },
  {
    title: '货物来源',
    dataIndex: 'sourceOfGoods',
    width: 160
  },
  {
    title: '订单来源',
    dataIndex: 'orderSource',
    width: 160
  },
  {
    title: '委托备注',
    dataIndex: 'delegatedRemarks',
    width: 160
  },
  {
    title: '创建人',
    dataIndex: 'founder',
    width: 160
  },
  {
    title: '创建时间',
    dataIndex: 'creationTime',
    width: 180,
    customRender: ({ text }) => {
      return useRender.renderDate(text)
    }
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    label: '唛头',
    field: 'shippingMark',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '订舱单号',
    field: 'bookingNumber',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '货物品名',
    field: 'goodsName',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '货物类型',
    field: 'goodsType',
    component: 'Select',
    componentProps: {
        options: []
    },
    colProps: { span: 8 }
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '总件数',
    field: 'total',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '总重量(KG)',
    field: 'weight',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '总体积(CBM)',
    field: 'volume',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '系统柜号',
    field: 'systemContainernumber',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '入仓单号',
    field: 'warehouseEntryNumber',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '入仓时间',
    field: 'warehousingTime',
    component: 'RangePicker',
    colProps: { span: 8 }
  },
  {
    label: '产品名称',
    field: 'productName',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '客户名称',
    field: 'customerName',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '客户类型',
    field: 'customerType',
    component: 'Select',
    componentProps: {
        options: []
    },
    colProps: { span: 8 }
  },
  {
    label: '客服',
    field: 'customerService',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '销售',
    field: 'sales',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '销售部门',
    field: 'salesDepartment',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '产品部门',
    field: 'productDepartment',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '产品公司',
    field: 'productCompany',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '业务类型',
    field: 'businessType',
    component: 'Select',
    componentProps: {
        options: []
    },
    colProps: { span: 8 }
  },
  {
    label: '内部结算价',
    field: 'insidePrice',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '应收状态',
    field: 'receivableState',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '应收价格',
    field: 'receivablePrice',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '因收币种',
    field: 'currencyType',
    component: 'Select',
    componentProps: {
        options: []
    },
    colProps: { span: 8 }
  },
  {
    label: '起始港',
    field: 'portOfOrigin',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '目的港',
    field: 'portOfDestination',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '仓库',
    field: 'warehouse',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '货物来源',
    field: 'sourceOfGoods',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '订单来源',
    field: 'orderSource',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '委托备注',
    field: 'delegatedRemarks',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '创建人',
    field: 'founder',
    component: 'Input',
    colProps: { span: 8 }
  },
  {
    label: '创建时间',
    field: 'creationTime',
    component: 'RangePicker',
    colProps: { span: 8 }
  },
]

export const createFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '唛头',
    field: 'shippingMark',
    component: 'Input'
  },
  {
    label: '订舱单号',
    field: 'bookingNumber',
    component: 'Input'
  },
  {
    label: '货物品名',
    field: 'goodsName',
    component: 'Input'
  },
  {
    label: '货物类型',
    field: 'goodsType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'Input'
  },
  {
    label: '总件数',
    field: 'total',
    component: 'Input'
  },
  {
    label: '总重量(KG)',
    field: 'weight',
    component: 'Input'
  },
  {
    label: '总体积(CBM)',
    field: 'volume',
    component: 'Input'
  },
  {
    label: '系统柜号',
    field: 'systemContainernumber',
    component: 'Input'
  },
  {
    label: '入仓单号',
    field: 'warehouseEntryNumber',
    component: 'Input'
  },
  {
    label: '入仓时间',
    field: 'warehousingTime',
    component: 'DatePicker'
  },
  {
    label: '产品名称',
    field: 'productName',
    component: 'Input'
  },
  {
    label: '客户名称',
    field: 'customerName',
    component: 'Input'
  },
  {
    label: '客户类型',
    field: 'customerType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '客服',
    field: 'customerService',
    component: 'Input'
  },
  {
    label: '销售',
    field: 'sales',
    component: 'Input'
  },
  {
    label: '销售部门',
    field: 'salesDepartment',
    component: 'Input'
  },
  {
    label: '产品部门',
    field: 'productDepartment',
    component: 'Input'
  },
  {
    label: '产品公司',
    field: 'productCompany',
    component: 'Input'
  },
  {
    label: '业务类型',
    field: 'businessType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '内部结算价',
    field: 'insidePrice',
    component: 'Input'
  },
  {
    label: '应收状态',
    field: 'receivableState',
    component: 'Input'
  },
  {
    label: '应收价格',
    field: 'receivablePrice',
    component: 'Input'
  },
  {
    label: '因收币种',
    field: 'currencyType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '起始港',
    field: 'portOfOrigin',
    component: 'Input'
  },
  {
    label: '目的港',
    field: 'portOfDestination',
    component: 'Input'
  },
  {
    label: '仓库',
    field: 'warehouse',
    component: 'Input'
  },
  {
    label: '货物来源',
    field: 'sourceOfGoods',
    component: 'Input'
  },
  {
    label: '订单来源',
    field: 'orderSource',
    component: 'Input'
  },
  {
    label: '委托备注',
    field: 'delegatedRemarks',
    component: 'Input'
  },
  {
    label: '创建人',
    field: 'founder',
    component: 'Input'
  },
  {
    label: '创建时间',
    field: 'creationTime',
    component: 'DatePicker'
  },
]

export const updateFormSchema: FormSchema[] = [
  {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input'
  },
  {
    label: '唛头',
    field: 'shippingMark',
    component: 'Input'
  },
  {
    label: '订舱单号',
    field: 'bookingNumber',
    component: 'Input'
  },
  {
    label: '货物品名',
    field: 'goodsName',
    component: 'Input'
  },
  {
    label: '货物类型',
    field: 'goodsType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'Input'
  },
  {
    label: '总件数',
    field: 'total',
    component: 'Input'
  },
  {
    label: '总重量(KG)',
    field: 'weight',
    component: 'Input'
  },
  {
    label: '总体积(CBM)',
    field: 'volume',
    component: 'Input'
  },
  {
    label: '系统柜号',
    field: 'systemContainernumber',
    component: 'Input'
  },
  {
    label: '入仓单号',
    field: 'warehouseEntryNumber',
    component: 'Input'
  },
  {
    label: '入仓时间',
    field: 'warehousingTime',
    component: 'DatePicker'
  },
  {
    label: '产品名称',
    field: 'productName',
    component: 'Input'
  },
  {
    label: '客户名称',
    field: 'customerName',
    component: 'Input'
  },
  {
    label: '客户类型',
    field: 'customerType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '客服',
    field: 'customerService',
    component: 'Input'
  },
  {
    label: '销售',
    field: 'sales',
    component: 'Input'
  },
  {
    label: '销售部门',
    field: 'salesDepartment',
    component: 'Input'
  },
  {
    label: '产品部门',
    field: 'productDepartment',
    component: 'Input'
  },
  {
    label: '产品公司',
    field: 'productCompany',
    component: 'Input'
  },
  {
    label: '业务类型',
    field: 'businessType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '内部结算价',
    field: 'insidePrice',
    component: 'Input'
  },
  {
    label: '应收状态',
    field: 'receivableState',
    component: 'Input'
  },
  {
    label: '应收价格',
    field: 'receivablePrice',
    component: 'Input'
  },
  {
    label: '因收币种',
    field: 'currencyType',
    component: 'Select',
    componentProps: {
        options:[]
    }
  },
  {
    label: '起始港',
    field: 'portOfOrigin',
    component: 'Input'
  },
  {
    label: '目的港',
    field: 'portOfDestination',
    component: 'Input'
  },
  {
    label: '仓库',
    field: 'warehouse',
    component: 'Input'
  },
  {
    label: '货物来源',
    field: 'sourceOfGoods',
    component: 'Input'
  },
  {
    label: '订单来源',
    field: 'orderSource',
    component: 'Input'
  },
  {
    label: '委托备注',
    field: 'delegatedRemarks',
    component: 'Input'
  },
  {
    label: '创建人',
    field: 'founder',
    component: 'Input'
  },
  {
    label: '创建时间',
    field: 'creationTime',
    component: 'DatePicker'
  },
]





export const infoSchema: FormSchema[] = [
  {
    label: '唛头',
    field: 'shippingMark',
    component: 'Input'
  },
  {
    label: '订舱单号',
    field: 'bookingNumber',
    component: 'Input'
  },
  {
    label: '货物品名',
    field: 'goodsName',
    component: 'Input'
  },
  {
    label: '货物类型',
    field: 'goodsType',
    component: 'Select',
    componentProps: {
      options:[]
    }
  },
  {
    label: '订单状态',
    field: 'orderState',
    component: 'Input'
  },
  {
    label: '总件数',
    field: 'total',
    component: 'Input'
  },
  {
    label: '总重量(KG)',
    field: 'weight',
    component: 'Input'
  },
  {
    label: '总体积(CBM)',
    field: 'volume',
    component: 'Input'
  },
  {
    label: '系统柜号',
    field: 'systemContainernumber',
    component: 'Input'
  },
  {
    label: '入仓单号',
    field: 'warehouseEntryNumber',
    component: 'Input'
  },
  {
    label: '入仓时间',
    field: 'warehousingTime',
    component: 'DatePicker'
  },
  {
    label: '产品名称',
    field: 'productName',
    component: 'Input'
  },
  {
    label: '客户名称',
    field: 'customerName',
    component: 'Input'
  },
  {
    label: '客户类型',
    field: 'customerType',
    component: 'Select',
    componentProps: {
      options:[]
    }
  },
  {
    label: '客服',
    field: 'customerService',
    component: 'Input'
  },
  {
    label: '销售',
    field: 'sales',
    component: 'Input'
  },
  {
    label: '销售部门',
    field: 'salesDepartment',
    component: 'Input'
  },
  {
    label: '产品部门',
    field: 'productDepartment',
    component: 'Input'
  },
  {
    label: '产品公司',
    field: 'productCompany',
    component: 'Input'
  },
  {
    label: '业务类型',
    field: 'businessType',
    component: 'Select',
    componentProps: {
      options:[]
    }
  },
  {
    label: '内部结算价',
    field: 'insidePrice',
    component: 'Input'
  },
  {
    label: '应收状态',
    field: 'receivableState',
    component: 'Input'
  },
  {
    label: '应收价格',
    field: 'receivablePrice',
    component: 'Input'
  },
  {
    label: '因收币种',
    field: 'currencyType',
    component: 'Select',
    componentProps: {
      options:[]
    }
  },
  {
    label: '起始港',
    field: 'portOfOrigin',
    component: 'Input'
  },
  {
    label: '目的港',
    field: 'portOfDestination',
    component: 'Input'
  },
  {
    label: '仓库',
    field: 'warehouse',
    component: 'Input'
  },
  {
    label: '货物来源',
    field: 'sourceOfGoods',
    component: 'Input'
  },
  {
    label: '订单来源',
    field: 'orderSource',
    component: 'Input'
  },
  {
    label: '委托备注',
    field: 'delegatedRemarks',
    component: 'Input'
  },
  {
    label: '创建人',
    field: 'founder',
    component: 'Input'
  },
  {
    label: '创建时间',
    field: 'creationTime',
    component: 'DatePicker'
  },
]


// 详情
export interface OrderInfo {
  orderId: number

}
export interface OrderInfo2 {
  orderId: number

}
